import request from "@/utils/request";

// 查询banner图片列表
export function listBanner(query) {
  return request({
    url: "/system/banner/list",
    method: "get",
    params: query,
  });
}

// 查询banner图片详细
export function getBanner(id) {
  return request({
    url: "/system/banner/" + id,
    method: "get",
  });
}

// 新增banner图片
export function addBanner(data) {
  return request({
    url: "/system/banner",
    method: "post",
    data: data,
  });
}

// 修改banner图片
export function updateBanner(data) {
  return request({
    url: "/system/banner",
    method: "put",
    data: data,
  });
}

// 删除banner图片
export function delBanner(id) {
  return request({
    url: "/system/banner/" + id,
    method: "delete",
  });
}

/**上架轮播图*/
export function setUpShelf(data) {
  return request({
    url: `/system/banner/up?id=${data}`,
    method: "get",
  });
}
/**下架轮播图 */
export function setDownShelf(data) {
  return request({
    url: `/system/banner/below?id=${data}`,
    method: "get",
  });
}
